home *** CD-ROM | disk | FTP | other *** search
Wrap
ssssccccaaaannnnffff((((3333SSSS)))) ssssccccaaaannnnffff((((3333SSSS)))) NNNNAAAAMMMMEEEE _ssss_cccc_aaaa_nnnn_ffff, _ffff_ssss_cccc_aaaa_nnnn_ffff, _ssss_ssss_cccc_aaaa_nnnn_ffff - convert formatted input SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_tttt_dddd_iiii_oooo_...._hhhh_>>>> _iiii_nnnn_tttt _ssss_cccc_aaaa_nnnn_ffff_((((_cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr _****_ffff_oooo_rrrr_mmmm_aaaa_tttt_,,,, _...._...._...._))))_;;;; _iiii_nnnn_tttt _ffff_ssss_cccc_aaaa_nnnn_ffff_((((_FFFF_IIII_LLLL_EEEE _****_ssss_tttt_rrrr_mmmm_,,,, _cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr _****_ffff_oooo_rrrr_mmmm_aaaa_tttt_,,,, _...._...._...._))))_;;;; _iiii_nnnn_tttt _ssss_ssss_cccc_aaaa_nnnn_ffff_((((_cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr _****_ssss_,,,, _cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr _****_ffff_oooo_rrrr_mmmm_aaaa_tttt_,,,, _...._...._...._))))_;;;; DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN _ssss_cccc_aaaa_nnnn_ffff reads from the standard input stream, _ssss_tttt_dddd_iiii_nnnn. _ffff_ssss_cccc_aaaa_nnnn_ffff reads from the stream _s_t_r_m. _ssss_ssss_cccc_aaaa_nnnn_ffff reads from the character string _s. Each function reads characters, interprets them according to a format, and stores the results in its arguments. Each expects, as arguments, a control string, _f_o_r_m_a_t, described below and a set of pointer arguments indicating where the converted input should be stored. If there are insufficient arguments for the format, the behavior is undefined. If the format is exhausted while arguments remain, the excess arguments are simply ignored. The control string usually contains conversion specifications, which are used to direct interpretation of input sequences. The control string may contain: 1. White-space characters (blanks, tabs, newlines, or form-feeds) that, except in two cases described below, cause input to be read up to the next non-white-space character. 2. An ordinary character (not _%%%%) that must match the next character of the input stream. 3. Conversion specifications consisting of the character _%%%% or the character sequence _%%%%_d_i_g_i_t_s_$$$$, an optional assignment suppression character _****, a decimal digit string that specifies an optional numerical maximum field width, an optional letter _llll (ell), _LLLL, or _hhhh indicating the size of the receiving object, and a conversion code. The conversion specifiers _dddd, _iiii, and _nnnn should be preceded by _hhhh if the corresponding argument is a pointer to _ssss_hhhh_oooo_rrrr_tttt _iiii_nnnn_tttt rather than a pointer to _iiii_nnnn_tttt, by _llll if it is a pointer to _llll_oooo_nnnn_gggg _iiii_nnnn_tttt or by _llll_llll if it is a pointer to a _llll_oooo_nnnn_gggg _llll_oooo_nnnn_gggg _iiii_nnnn_tttt. Similarly, the conversion specifiers _oooo, _uuuu, and _xxxx should be preceded by _hhhh if the corresponding argument is a pointer to _uuuu_nnnn_ssss_iiii_gggg_nnnn_eeee_dddd _ssss_hhhh_oooo_rrrr_tttt _iiii_nnnn_tttt rather than a pointer to _uuuu_nnnn_ssss_iiii_gggg_nnnn_eeee_dddd _iiii_nnnn_tttt, by _llll if it is a pointer to _uuuu_nnnn_ssss_iiii_gggg_nnnn_eeee_dddd _llll_oooo_nnnn_gggg _iiii_nnnn_tttt, or by _llll_llll if it is a pointer to a _uuuu_nnnn_ssss_iiii_gggg_nnnn_eeee_dddd _llll_oooo_nnnn_gggg _llll_oooo_nnnn_gggg _iiii_nnnn_tttt. The conversion specifiers _eeee, _ffff, and _gggg should be preceded by _llll if the corresponding argument is a pointer to _dddd_oooo_uuuu_bbbb_llll_eeee rather than a pointer to _ffff_llll_oooo_aaaa_tttt. The conversion PPPPaaaaggggeeee 1111 ssssccccaaaannnnffff((((3333SSSS)))) ssssccccaaaannnnffff((((3333SSSS)))) specifiers _eeee, _ffff, and _gggg should be preceded by _LLLL if the corresponding argument is a pointer to _llll_oooo_nnnn_gggg _dddd_oooo_uuuu_bbbb_llll_eeee rather than a pointer to _ffff_llll_oooo_aaaa_tttt. Finally, the conversion specifiers _cccc and _ssss should be preceded by _llll if the corresponding argument points to an array of type _wwww_cccc_hhhh_aaaa_rrrr______tttt. This will result in the same behavior as using the _CCCC and _SSSS specifiers (described below). The _hhhh, _llll, _llll_llll, or _LLLL modifier is ignored with any other conversion specifier. A conversion specification directs the conversion of the next input field; the result is placed in the variable pointed to by the corresponding argument unless assignment suppression was indicated by the character _****. The suppression of assignment provides a way of describing an input field that is to be skipped. An input field is defined as a string of non-space characters; it extends to the next inappropriate character or until the maximum field width, if one is specified, is exhausted. For all descriptors except the character _[[[[ and the character _cccc, white space leading an input field is ignored. Conversions can be applied to the _n_t_h argument in the argument list, rather than to the next unused argument. In this case, the conversion character _%%%% (see above) is replaced by the sequence _%%%%_d_i_g_i_t_s_$$$$ where _d_i_g_i_t_s is a decimal integer _n, giving the position of the argument in the argument list. The first such argument, _%%%%_1111_$$$$, immediately follows _f_o_r_m_a_t. The control string can contain either form of a conversion specification, i.e., _%%%% or _%%%%_d_i_g_i_t_s_$$$$, although the two forms cannot be mixed within a single control string. The conversion code indicates the interpretation of the input field; the corresponding pointer argument must usually be of a restricted type. For a suppressed field, no pointer argument is given. The following conversion codes are valid: _%%%% A single _%%%% is expected in the input at this point; no assignment is done. _dddd Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of the _ssss_tttt_rrrr_tttt_oooo_llll function with the value 10 for the _b_a_s_e argument. The corresponding argument should be a pointer to integer. _uuuu Matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of the _ssss_tttt_rrrr_tttt_oooo_uuuu_llll function with the value 10 for the _b_a_s_e argument. The corresponding argument should be a pointer to unsigned integer. _oooo Matches an optionally signed octal integer, whose format is the same as expected for the subject sequence of the _ssss_tttt_rrrr_tttt_oooo_uuuu_llll function with the value 8 for the _b_a_s_e argument. The corresponding argument should be a pointer to unsigned integer. PPPPaaaaggggeeee 2222 ssssccccaaaannnnffff((((3333SSSS)))) ssssccccaaaannnnffff((((3333SSSS)))) _xxxx Matches an optionally signed hexadecimal integer, whose format is the same as expected for the subject sequence of the _ssss_tttt_rrrr_tttt_oooo_uuuu_llll function with the value 16 for the _b_a_s_e argument. The corresponding argument should be a pointer to unsigned integer. _iiii Matches an optionally signed integer, whose format is the same as expected for the subject sequence of the _ssss_tttt_rrrr_tttt_oooo_llll function with the value 0 for the _b_a_s_e argument. The corresponding argument should be a pointer to integer. _nnnn No input is consumed. The corresponding argument should be a pointer to integer into which is to be written the number of characters read from the input stream so far by the call to the function. Execution of a _%%%%_nnnn directive does not increment the assignment count returned at the completion of execution of the function. _eeee,_ffff,_gggg Matches an optionally signed floating point number, whose format is the same as expected for the subject string of the _ssss_tttt_rrrr_tttt_oooo_dddd function. The corresponding argument should be a pointer to floating. _ssss A character string is expected; the corresponding argument should be a character pointer pointing to an array of characters large enough to accept the string and a terminating _\\\\_0000, which will be added automatically. The input field is terminated by a white-space character. _SSSS Same as _ssss except that the corresponding argument should be a _wwww_cccc_hhhh_aaaa_rrrr______tttt pointer pointing to an array of _wwww_cccc_hhhh_aaaa_rrrr______tttt large enough to accept the string and a terminating _\\\\_0000, which will be added automatically. _cccc Matches a sequence of characters of the number specified by the field width (1 if no field width is present in the directive). The corresponding argument should be a pointer to the initial character of an array large enough to accept the sequence. No null character is added. The normal skip over white space is suppressed. _CCCC Same as _cccc except that the corresponding argument should be a pointer to the initial character of an array of type _wwww_cccc_hhhh_aaaa_rrrr______tttt large enough to accept the sequence. _[[[[ Matches a nonempty sequence of characters from a set of expected characters (the _s_c_a_n_s_e_t). The corresponding argument should be a pointer to the initial character of an array large enough to accept the sequence and a terminating null character, which will be added automatically. The conversion specifier includes all subsequent characters in the _f_o_r_m_a_t string, up to and including the matching right bracket (_]]]]). The characters between the brackets (the _s_c_a_n_l_i_s_t) comprise the scanset, unless the character after the left bracket is a circumflex (_^^^^), in which case the scanset contains all characters that do not appear in the scanlist between the circumflex PPPPaaaaggggeeee 3333 ssssccccaaaannnnffff((((3333SSSS)))) ssssccccaaaannnnffff((((3333SSSS)))) and the right bracket. If the conversion specifier begins with _[[[[_]]]] or _[[[[_^^^^_]]]], the right bracket character is in the scanlist and the next right bracket character is the matching right bracket that ends the specification; otherwise the first right bracket character is the one that ends the specification. A range of characters in the scanset may be represented by the construct _f_i_r_s_t _---- _l_a_s_t; thus _[[[[_0000_1111_2222_3333_4444_5555_6666_7777_8888_9999_]]]] may be expressed _[[[[_0000_----_9999_]]]]. Using this convention, _f_i_r_s_t must be lexically less than or equal to _l_a_s_t, or else the dash will stand for itself. The character _---- will also stand for itself whenever it is the first or the last character in the scanlist. To include the right bracket as an element of the scanset, it must appear as the first character (possibly preceded by a circumflex) of the scanlist and in this case it will not be syntactically interpreted as the closing bracket. At least one character must match for this conversion to be considered successful. _pppp Matches an implementation-defined set of sequences, which should be the same as the set of sequences that may be produced by the _%%%%_pppp conversion of the _pppp_rrrr_iiii_nnnn_tttt_ffff function. The corresponding argument should be a pointer to _vvvv_oooo_iiii_dddd. The interpretation of the input item is implementation-defined. If the input item is a value converted earlier during the same program execution, the pointer that results shall compare equal to that value; otherwise, the behavior of the _%%%%_pppp conversion is undefined. If an invalid conversion character follows the _%%%%, the results of the operation may not be predictable. The conversion specifiers _EEEE, _GGGG, and _XXXX are also valid and behave the same as _eeee, _gggg, and _xxxx, respectively. Each function allows for detection of a language-dependent decimal-point character in the input string. The decimal-point character is defined by the program's locale (category _LLLL_CCCC______NNNN_UUUU_MMMM_EEEE_RRRR_IIII_CCCC). In the _""""_CCCC_"""" locale, or in a locale where the decimal-point character is not defined, the decimal- point character defaults to a period (_....). The _ssss_cccc_aaaa_nnnn_ffff conversion terminates at end-of-file, at the end of the control string, or when an input character conflicts with the control string. If end-of-file is encountered during input, conversion is terminated. If end-of-file occurs before any characters matching the current directive have been read (other than leading white space, where permitted), execution of the current directive terminates with an input failure; otherwise, unless execution of the current directive is terminated with a matching failure, execution of the following directive (if any) is terminated with an input failure. PPPPaaaaggggeeee 4444 ssssccccaaaannnnffff((((3333SSSS)))) ssssccccaaaannnnffff((((3333SSSS)))) If conversion terminates on a conflicting input character, the offending input character is left unread in the input stream. Trailing white space (including newline characters) is left unread unless matched by a directive. The success of literal matches and suppressed assignments is not directly determinable other than via the _%%%%_nnnn directive. EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS The call to the function _ssss_cccc_aaaa_nnnn_ffff: _iiii_nnnn_tttt _iiii_,,,, _nnnn_;;;; _ffff_llll_oooo_aaaa_tttt _xxxx_;;;; _cccc_hhhh_aaaa_rrrr _nnnn_aaaa_mmmm_eeee_[[[[_5555_0000_]]]]_;;;; _nnnn _==== _ssss_cccc_aaaa_nnnn_ffff _((((_""""_%%%%_dddd_%%%%_ffff_%%%%_ssss_""""_,,,, _&&&&_iiii_,,,, _&&&&_xxxx_,,,, _nnnn_aaaa_mmmm_eeee_))))_;;;; with the input line: _2222_5555 _5555_4444_...._3333_2222_EEEE_----_1111 _tttt_hhhh_oooo_mmmm_pppp_ssss_oooo_nnnn will assign to _nnnn the value _3333, to _iiii the value _2222_5555, to _xxxx the value _5555_...._4444_3333_2222, and _nnnn_aaaa_mmmm_eeee will contain _tttt_hhhh_oooo_mmmm_pppp_ssss_oooo_nnnn_\\\\_0000. The call to the function _ssss_cccc_aaaa_nnnn_ffff: _iiii_nnnn_tttt _iiii_;;;; _ffff_llll_oooo_aaaa_tttt _xxxx_;;;; _cccc_hhhh_aaaa_rrrr _nnnn_aaaa_mmmm_eeee_[[[[_5555_0000_]]]]_;;;; _((((_vvvv_oooo_iiii_dddd_)))) _ssss_cccc_aaaa_nnnn_ffff _((((_""""_%%%%_2222_dddd_%%%%_ffff_%%%%_****_dddd _%%%%_[[[[_0000_----_9999_]]]]_""""_,,,, _&&&&_iiii_,,,, _&&&&_xxxx_,,,, _nnnn_aaaa_mmmm_eeee_))))_;;;; with the input line: _5555_6666_7777_8888_9999 _0000_1111_2222_3333 _5555_6666_aaaa_7777_2222 will assign _5555_6666 to _iiii, _7777_8888_9999_...._0000 to _xxxx, skip _0000_1111_2222_3333, and place the characters _5555_6666_\\\\_0000 in _nnnn_aaaa_mmmm_eeee. The next character read from _ssss_tttt_dddd_iiii_nnnn will be _aaaa. SSSSEEEEEEEE AAAALLLLSSSSOOOO _cccc_cccc(1), _ssss_tttt_rrrr_tttt_oooo_dddd(3C), _ssss_tttt_rrrr_tttt_oooo_llll(3C), _pppp_rrrr_iiii_nnnn_tttt_ffff(3S). DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS These routines return the number of successfully matched and assigned input items; this number can be zero in the event of an early matching failure between an input character and the control string. If the input ends before the first matching failure or conversion, _EEEE_OOOO_FFFF is returned. PPPPaaaaggggeeee 5555